<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<title>{:C('defaultinfo.name')} - Powered By {:L('AUTHOR')}</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">		
		<meta name="description" content=""/>
		<meta name="author" content="{:L('AUTHOR')}"/>
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />		
		<link type="text/css" href="__PUBLIC__/css/app.css" rel="stylesheet" />
		<link rel="shortcut icon" href="__PUBLIC__/ico/favicon.png"/>
		<script src="__PUBLIC__/js/jquery-1.9.0.min.js" type="text/javascript"></script>	
		<script type="text/javascript" src="__PUBLIC__/js/zh_CN.js"></script>
		<script type="text/javascript" src="__PUBLIC__/js/kindeditor-all-min.js"></script>
		<script src="__PUBLIC__/js/PCASClass.js" type="text/javascript"></script>
		<script type="text/javascript" src="__PUBLIC__/js/formValidator-4.0.1.min.js" charset="UTF-8"></script>
		<script src="__PUBLIC__/js/jquery-ui-1.10.0.custom.min.js" type="text/javascript"></script>	
		<link rel="stylesheet" href="__PUBLIC__/css/kindeditor.css" type="text/css" />
		<script src="__PUBLIC__/js/WdatePicker.js" type="text/javascript"></script>
		<style>
			select, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {height:45px;}
			#owner_role_id{width:85px;}
		</style>
	</head>
	<body>
		<form id="form1" action="{:U(leads/add)}" method="post">
			<table class="table">
				<div style="width:100%;float:left;">
					<div class="title_a" style="float:left;"><p>基本信息</p></div>
					<div class="trborder">
						<div class="tdleft" >负责人</div>
						<div class="tdright">							
							{$owner_name}</br><span>*如不选择则默认进入线索池</span>
						</div>
					</div>
					<!-- <tr class="trborder">
						<td class="tdleft" >放入客户池</td>
						<td><input class="btn" id="remove"  type="button" value="立即放入"/></td>
					</tr> -->
					<volist name="field_list['main']" id="vo"> 
						<div class="trborder">
							<div class="tdleft">{$vo.name}</div>
							<div class="<if condition="$vo.form_type eq 'box'">tdright<else />tdright tdrightt</if>">{$vo.html}</div>
						</div>                        
					</volist>
					<div class="title_a" style="float:left;"><p>首要联系人信息</p></div>
					<div class="trborder">
						<div class="tdleft" >姓名</div>
						<div class="tdright" ><input class="user_input" type="text" name="con_name" /></div>
					</div>
					<div class="trborder">
						<div class="tdleft" >称呼</div>
						<div class="tdright"><input class="user_input" type="text" name="saltname" /></div>					
					</div>
					<div class="trborder">
						<div class="tdleft" >邮箱</div>
						<div class="tdright"><input class="user_input" name="con_email" type="text"/></div>
					</div>
					<div class="trborder">					
						<div class="tdleft" >职位</div>
						<div class="tdright">
							<input class="user_input" type="text" name="con_post"/>
						</div>
					</div>
					<div class="trborder">
						<div class="tdleft">QQ</div>
						<div class="tdright"><input class="user_input" name="con_qq" type="text" /></div>					
					</div>
					<div class="trborder">
						<div class="tdleft" >手机</div>
						<div class="tdright"><input class="user_input" name="con_telephone" type="text" /></div>
					</div>
					<div class="trborder">
						<div class="tdleft" >备注</div>
						<div class="tdright"><textarea class="span8" rows="3" name="con_description" ></textarea></div>
					</div>
					<!-- <volist name="contacts_field_list['data']" id="vo"> 
						<div class="trborder">
							<div class="tdleft" width="35%">{$vo.name}</div>
							<div class="<if condition="$vo.form_type eq 'box'">tdright<else />tdright tdrightt</if>">{$vo.html}</div>
						</div>                        
					</volist> -->
					<div class="title_a" style="float:left;"><p>附加信息</p></div>
					<volist name="field_list['data']" id="vo"> 
						<div class="trborder">
							<div class="tdleft">{$vo.name}</div>
							<div class="<if condition="$vo.form_type eq 'box'">tdright<else />tdright tdrightt</if>">{$vo.html}</div>
						</div>                        
					</volist>
					<div class="tfoot">
						<div class="tfoot_a">
							<input class="btn btn-primary" id="submit" name="submit" type="submit" value="保存"/>					
							<!--<input type="checkbox" name="create_business2" value="1"/>同时创建商机</td>-->
						</div>
					</div>
				</div>
			</table>
		</form>
<script>
$(function(){
	$('#remove').click(
		function(){			
			$('#owner_role_id').val('');				
		}
	);	
	
})
$(function(){
    $.formValidator.initConfig({formID:"form1",debug:false,submitOnce:true,
        onError:function(msg,obj,errorlist){
        alert(msg);
    },
    submitAfterAjaxPrompt : '有数据正在异步验证，请稍等'
});
<volist name="field_list[main]" id="vo">
    <if condition="$vo['is_validate'] == 1">
        <if condition="$vo['form_type'] != 'box' || $vo['setting']['type'] == 'select'">
	        $("#{$vo['field']}").formValidator({
	            tipID:"{$vo['field']}Tip",
	            <if condition="$vo['is_null'] == 1">
	            onShow:"<span style='color:red;'>*必填项</span>",
				empty:false,
	            <else />
	            onShow:" ",
				empty:true,
	            </if>
	            onFocus:" ",
	            onCorrect:"<span style='color:green;'>√</span>"
	        }).inputValidator({
	            <if condition="$vo['is_null'] == 1">
	            min:1,max:{$vo[max_length]|default="255"},
	            onshow:"<font style='color:red;'>{:L('NOT NULL',array($vo[name]))}</font>",
	            <else />
	            min:0,max:{$vo[max_length]|default="255"},
	            </if>
	            onErrorMin:"{:L('NOT NULL',array($vo[name]))}",
	            onErrorMax:"{:L('MAXIMUM_REQUEST_LENGTH_EXCEEDED',array($vo[name]))}"
	         });
            <if condition="$vo['form_type'] == 'email'">
            $("#{$vo[field]}").regexValidator({
                regExp:"email",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'mobile'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"mobile",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'phone'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"tel",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'datetime'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"date",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'number'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"num",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
             </if>
             <if condition="$vo['is_unique'] == 1 && $vo['field']!='name'">
            $("#{$vo[field]}").ajaxValidator({
                dataType : "json",
                type : "GET",
                async : true,
                url : "{:U('leads/validate')}",
                success : function(data){
                    if( data.status == 1 ) return false;
                    if( data.status == 0 ) return true;
                    return false;
                },
                error: function(jqXHR, textStatus, errorThrown){alert("{:L('The_server_did_not_return_data_may_be_the_server_busy_please_try_again')}"+errorThrown);},
                onError : "{:L('THIS_DISABLED_PLEASE_CHANGE',array($vo[name],$vo[name]))}",
                onWait : "{:L('LEGITIMACY_CHECKING_PLEASE_WAIT',array($vo[name]))}"
            }); 
             </if>
         <else />
             <if condition="$vo['setting']['type'] == 'checkbox'">
             $(":checkbox[name='{$vo['field']}[]']").formValidator({
                 tipID:"{$vo[field]}Tip",
                 <if condition="$vo['is_null'] == 1">
                 onShow:"<span style='color:red;'>*必填项</span>",
                 <else />
                 onShow:" ",
                 </if>
                 onFocus:" ",
                 onCorrect:"<span style='color:green;'>√</span>"
             }).inputValidator({
             	<if condition="$vo['is_null'] == 1">
                 min:1,
                 <else/>
                 min:0,
                 </if>
             	onError:"{:L('PLEASE_SELECT',array($vo[name]))}"
             });
             <else />
             $(":radio[name='{$vo['field']}']").formValidator({
                 tipID:"{$vo[field]}Tip",
                 <if condition="$vo['is_null'] == 1">
                 onShow:"<span style='color:red;'>*必填项</span>",
                 <else />
                 onShow:" ",
                 </if>
                 onFocus:" ",
                 onCorrect:"<span style='color:green;'>√</span>"
             }).inputValidator({
             	<if condition="$vo['is_null'] == 1">
                 min:1,
                 <else/>
                 min:0,
                 </if>
             	onError:"{:L('PLEASE_SELECT',array($vo[name]))}"
             });
             </if>
         </if>
     </if>
</volist>
<volist name="field_list[data]" id="vo">
    <if condition="$vo['is_validate'] == 1">
        <if condition="$vo['form_type'] != 'box' || $vo['setting']['type'] == 'select'">
	        $("#{$vo['field']}").formValidator({
	            tipID:"{$vo['field']}Tip",
	            <if condition="$vo['is_null'] == 1">
	            onShow:"<span style='color:red;'>*必填项</span>",
				empty:false,
	            <else />
	            onShow:" ",
				empty:true,
	            </if>
	            onFocus:" ",
	            onCorrect:"<span style='color:green;'>√</span>"
	        }).inputValidator({
	            <if condition="$vo['is_null'] == 1">
	            min:1,max:{$vo[max_length]|default="255"},
	            onshow:"<font style='color:red;'>{:L('NOT NULL',array($vo[name]))}</font>",
	            <else />
	            min:0,max:{$vo[max_length]|default="255"},
	            </if>
	            onErrorMin:"{:L('NOT NULL',array($vo[name]))}",
	            onErrorMax:"{:L('MAXIMUM_REQUEST_LENGTH_EXCEEDED',array($vo[name]))}"
	         });
            <if condition="$vo['form_type'] == 'email'">
            $("#{$vo[field]}").regexValidator({
                regExp:"email",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'mobile'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"mobile",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'phone'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"tel",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'datetime'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"date",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
            <elseif condition="$vo['form_type'] == 'number'"/>
             $("#{$vo[field]}").regexValidator({
                regExp:"num",
                dataType:"enum",
                onError:"{:L('A_OLUTE_OR_SELF_RELATIVE',array($vo[name]))}"
            });
             </if>
             <if condition="$vo['is_unique'] == 1 && $vo['field']!='name'">
            $("#{$vo[field]}").ajaxValidator({
                dataType : "json",
                type : "GET",
                async : true,
                url : "{:U('leads/validate')}",
                success : function(data){
                    if( data.status == 1 ) return false;
                    if( data.status == 0 ) return true;
                    return false;
                },
                error: function(jqXHR, textStatus, errorThrown){alert("{:L('The_server_did_not_return_data_may_be_the_server_busy_please_try_again')}"+errorThrown);},
                onError : "{:L('THIS_DISABLED_PLEASE_CHANGE',array($vo[name],$vo[name]))}",
                onWait : "{:L('LEGITIMACY_CHECKING_PLEASE_WAIT',array($vo[name]))}"
            }); 
             </if>
         <else />
             <if condition="$vo['setting']['type'] == 'checkbox'">
             $(":checkbox[name='{$vo['field']}[]']").formValidator({
                 tipID:"{$vo[field]}Tip",
                 <if condition="$vo['is_null'] == 1">
                 onShow:"<span style='color:red;'>*必填项</span>",
                 <else />
                 onShow:" ",
                 </if>
                 onFocus:" ",
                 onCorrect:"<span style='color:green;'>√</span>"
             }).inputValidator({
             	<if condition="$vo['is_null'] == 1">
                 min:1,
                 <else/>
                 min:0,
                 </if>
             	onError:"{:L('PLEASE_SELECT',array($vo[name]))}"
             });
             <else />
             $(":radio[name='{$vo['field']}']").formValidator({
                 tipID:"{$vo[field]}Tip",
                 <if condition="$vo['is_null'] == 1">
                 onShow:"<span style='color:red;'>*必填项</span>",
                 <else />
                 onShow:" ",
                 </if>
                 onFocus:" ",
                 onCorrect:"<span style='color:green;'>√</span>"
             }).inputValidator({
             	<if condition="$vo['is_null'] == 1">
                 min:1,
                 <else/>
                 min:0,
                 </if>
             	onError:"{:L('PLEASE_SELECT',array($vo[name]))}"
             });
             </if>
         </if>
     </if>
</volist>
});
</script>
	</body>
</html>